<template>
  <div>
    <div class="dy_name">
      <!-- 性别页面布局开始 -->
      <div class="dy_head">
        <!-- tou -->
        <van-icon name="arrow-left" @click="go" />
        <p>修改个人信息</p>
        <p @click="cun">保存</p>
        <!-- tou -->
      </div>
      <div class="dy_con">
        <ul>
          <li>男</li>
          <li>女</li>
        </ul>
        <input type="text" v-model="sex" class="aa" />
      </div>
    </div>
  </div>
</template>

<script>
import {user} from '../../request/http'
export default {
  name: "",
  data() {
    return {
      sex: ""
    };
  },
  props: [],
  components: {},
  mounted() {
    console.log(this.$route.query.sex);
    this.sex = this.$route.query.sex;
  },
  methods: {
    go() {
      this.$router.go(-1);
    },
    cun() {
      user({ sex: this.sex }).then(res => {
        //   console.log(res)
        this.$toast("修改成功");
        this.$router.go(-1);
      });
    }
  }
};
</script>

<style scoped>
.dy_name {
  width: 100%;
  height: 100%;
  font-size: 16px;
  line-height: 20px;
}
.dy_head {
  height: 50px;
  display: flex;
  background: #fff;
  align-items: center;
  padding: 0 10px;
}
.dy_head > p:nth-of-type(1) {
  height: auto;
  width: 290px;
  text-align: center;
}
input {
  width: 100%;
  height: 40px;
  font-size: 16px;
  border: none;
  margin-top: 10px;
  box-sizing: border-box;
  padding-left: 10px;
}
.dy_con > ul {
  margin-top: 15px;
  width: 100%;
  background: #fff;
}
.dy_con>ul>li{
    padding-left: 10px;
    height: 50px;
    line-height: 50px;
    font-size: 15px;
    color: #595959;
    position: relative;
    padding-right: 30px;
    border-bottom: 1px solid #f0f0f0;
}
</style>